// Copyright (C) 2021 Focus Media Holding Ltd. All Rights Reserved.

package cn.focusmedia.central.${appCode}.domain.${modelPackName}.convert;

import org.springframework.beans.BeanUtils;
import org.springframework.stereotype.Component;

import cn.focusmedia.central.${appCode}.domain.${modelPackName}.domainobject.${className};
import cn.focusmedia.central.${appCode}.domain.${modelPackName}.domainobject.query.${className}Query;
import cn.focusmedia.central.${appCode}.tunnel.dataobject.${modelPackName}.${className}DO;
import cn.focusmedia.fdf.common.convert.BaseDomainConvert;

/**
 * ${className}DomainConvert
 *
 * @author ${author}
 * @since  ${date}
 **/
@Component
public class ${className}DomainConvert extends BaseDomainConvert<${className}, ${className}DO> {

    @Override
    public ${className}DO domain2DO(${className} source) {
        ${className}DO target = new ${className}DO();
        if (null != source) {
            BeanUtils.copyProperties(source, target);
        }
        return target;
    }

    @Override
    public ${className} do2Domain(${className}DO source) {
        ${className} target = new ${className}();
        if (null != source) {
            BeanUtils.copyProperties(source, target);
        }
        return target;
    }


    public ${className}DO convertQuery2DO(${className}Query source) {
        ${className}DO target = new ${className}DO();
        if (null != source) {
            BeanUtils.copyProperties(source, target);
        }
        return target;
    }

}
